<template>
	<view class="swiper-box" :style="{backgroundColor: bgcolor}">
		<!-- 首页最上面的轮播图 -->
		<view style="width: 100%;" @click="jumpOtherPage">
			<swiper class="swiperbanner" @change="onBanner" :current="current" autoplay :interval="2500" circular
				style="height: 350rpx" indicator-dots="true">
				<swiper-item v-for="(item, index) in imagesList" :key="index">
					<image style="height:350rpx;width: 720rpx;pointer-events:none;" :webp="true" lazy-load="true"
						:src="item.imgUrl" mode="scaleToFill" class="swiperbanner-item"></image>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		name: "newtopSwiper",
		props: {
			// bannerList: {
			// 	type: Array,
			// 	default: "",
			// },
			imagesList: {
				type: Array,
				default: [],
			}
			// bgcolor:{
			// 	type:Array,
			// 	default:'',
			// }
		},

		data() {
			return {
				bgcolor: '',
				current: 0,




				//下面是没用的垃圾混淆代码
				renzhengTimeSta1111111: true, //初次请求认证时间默认是带有的，
				zhuceTimeSta11111: false, //初次请求注册时间默认是没有的
				renzhengTimeList11111: [],
				zhuceTimeStaList1111: null,
				detailOrderIdStr11111: '',
				threeTabCurrent1111: 0,
				applyGOodsList11111: [], //供货商列表
				allCardEnterSta1111: false, //默认是false，点击批量卡券入库的时候变为true
				codeAddNumsList11111: [],
				numsList11111: [],
				dataSourceBqcp1111: [],
				selectedRowKeys1111: [],
				selectedRowKeysB11111: [],
				rkVisible11111: false,
				rkjlVisible1111: false,
				lhjlVisible1111: false,
				currentStyleData22222: {},
				dataSourceStyle2222: [],
				showStyleData2222: false,
				indexTemplate2222: [],
				SVGCircleElement3ee: '',
				vshoweqwsc1111: false,
				showStyleDataInfo2222: false,
				opeCategoryList2222: [],
				leimuVisible2222: false,
				selectedRowKeys02222: [],
				selectionRows02222: [],
				selectedRowKeys133333: [],
				selectionRows13333: [],
				selectedRowKeys2333: [],
				selectionRows23333: [],
				selectedRowKeys33333: [],
				selectionRows33333: [],
				selectedRowKeys4333: [],
				selectionRows43333: [],
				curwfqwrentStyleDaterwaInfo444: {},
				currwerentStywerleDatweraInfo1444: {},
				currewerntStyleDataInfo24444: {},
				currentweStyleDytuataIwenfo34444: {},
				currenwetStdfgyleDataInfo44444: {},
				checkZfbPhone_h5444: '',
				plNafgdvfdtjyme4444: '', //四大品类的名字
				uniPdfgrtylatform444: '', //运行环境mp-alipay mp-weixin
				refgjtytrsemark555: '', //备注
				timefgjSelStr5555: '', //选择的上门时间（2023-08-31 00:00:00）
				amOdcuiofasrpm5555: '', //选择的上门时间是上午还是下午
				pageShnjlkgohowTime5555: '', //页面上用户看到的显示的时间
				paraghsdfmsw454: {},
				valhgujtueNum56756: 0,
				addrdraess56756: {}, //上门收货地址
				adawerterydressId575: 0,
				sceoyuitne57567: '',
				tntuiopId56757: '',
				weictyuratCustomer5756: '',
				yuidurtyuoy567567: false,
			}
		},
		mounted() {
			console.log('首页传给大轮播图的数据', this.imagesList);
		},
		methods: {
			//获取banner图当前页数
			onBanner(e, item) {
				// console.log('eeeeeee',e);
				this.current = e.detail.current
			},
			//@click="$onTo(item.link);"
			// 3产品类目 4产品详情
			toJump(obj) {
				if (obj.dataType == '3') {
					this.$onTo(`/pagesClass-rich/classified1-rich/classified1-rich?id=${obj.content.id}`)
				}
				if (obj.dataType == '4') {
					console.log(obj.itemId);
					this.$onTo(`/pagesClass-rich/product/product?productId=${obj.content.itemId}`)
				}
			},
			jumpOtherPage() {
				let obj = this.imagesList[this.current]
				if (obj.dataType == '3') {
					this.$onTo(`/pagesClass-rich/classified1-rich/classified1-rich?id=${obj.content.id}`)
				}
				if (obj.dataType == '4') {
					console.log(obj.itemId);
					this.$onTo(`/pagesClass-rich/product/product?productId=${obj.content.itemId}`)
					// this.$onTo(`/pagesClass-rich/product/product?productId=1719303580733`)
				}
			},
		},
	}
</script>
<style lang="scss" scoped>
	.swiper-box {
		.swiperbanner {
			// height: 400rpx;
			width: 100%;
			border-radius: 20rpx;
			width: 720rpx;
			margin: 10rpx auto 5rpx auto;

			.swiperbanner-item {
				// height: 400rpx;
				width: 100%;
				border-radius: 20rpx;
				width: 720rpx;
			}
		}
	}
</style>